package com.xxgc.cloud.auth.springcloudauth.controller.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Pattern;

/**
 * @program: SpringCloudStudy
 * @description: 用户登录
 * @author: Mr.abel(ShiJiaYi)
 * @create: 2022-11-28 20:01
 **/
@Data
@ToString
@ApiModel(value = "Users登录对象", description = "用户")
public class UserLoginDTO {
    @Length(min=8,max=18,message = "密码长度必须为8-18位")
    @ApiModelProperty(value = "密码", required = true)
    private String userPass;

    @Pattern(regexp = "^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\\d{8}$", message = "手机号格式不正确")
    @ApiModelProperty(value = "电话", required = true)
    private String phoneNumber;
}
